Requirements of the Google Maps API
Learn about the requirements for the API design of Google Maps.
Introduction to Google Maps API#
Google Maps is the most popular map application that users use on a daily basis for travel. Traveling from one location to another requires some essential information, such as the distance to be traveled in miles, an estimation of travel time, an optimal path based on traffic conditions, and driving directions. All these requirements can be achieved by interacting with different APIs of Google Maps. Designing an API like Google Maps requires an understanding of the internal working of its system because an API is a reflection of the backend system design. In this chapter, we'll first learn about the design of the API by going over the different services and interactions between them.
Note: An optimal path is not always the shortest one, but rather the one that works well in real-world and considers things like time, road closures, business needs, and so on.
Let's go over the functional and non-functional requirements for designing the Google Maps API.
Requirements#
Let's understand the functional and non-functional requirements for designing the Google Maps API.
Functional requirements#
The functional requirements are as follows:
Map: The API should be able to return a specific map area as a snapshot based on the user's location.
Route finder: The API should return the optimal path(s) with distance and the estimated time of arrival (ETA) based on the source, destination, and mode of transportation.
Navigation: When the user starts navigating toward the destination. The navigation service takes the user's location from the global positioning system (GPS) and helps users to make correct decisions along the route. At the same time, the navigation service updates the ETA and distance.
The Global Positioning System (GPS) consists of over 30 satellites and a receiver installed in our devices, such as mobile phones. Our mobile phone helps us identify an accurate location by constantly communicating with multiple (usually 3-4) satellites. A final position is estimated using the measurements of time and distance between the user and the satellites.
It should be noted that the initial version of GPS dates back to 1978-79, though some updates have been made over the years. Still, there are some errors in the GPS reading system. A modern GPS system is accurate within a few meters, and a typical GPS reading error is less than 10 meters.
Search place: The API should find and return the information of the searched location/entity.
Non-functional requirements#
The non-functional requirements of the Google Maps API are as follows:
Availability: The API should have high availability, allowing users to perform desired operations.
Accuracy: The API should return the optimal route(s) with an accurate ETA.
Scalability: The API should be scalable to handle a large number of user requests.
Low latency: The API should return the response of all services in real time. Although different functional requirements may have different latency requirements, our service should be able to provide responses or updates as the service demands. For instance, a service like navigation will have stringent latency requirements.
Prerequisites#
We have designed some other APIs in this course that will benefit us in the creation of the Google Maps API. They will act as building blocks for our design and are listed below:
Search API: This API allows users to find any place on a map.
Pub-sub API: This API is required to achieve inter-services communication. For example, if the user deviates from the suggested path, then the navigation service pings the route finder service for re-routing via a pub-sub service.
How will we design the Google Maps API?#
This chapter is structured as follows:
Google Maps API Design Decisions: This lesson will focus on the workflow and design considerations for our Google Maps services.
API Model for Google Maps Service: This lesson will focus on defining the endpoints and the request-response format for the API calls.
Google Maps API Design Evaluation and Latency Budget: This lesson will cover how we can achieve non-functional requirements and estimate the latency budget for our Google Maps API.
Let's start with design decisions in the next lesson.
Messenger API Design Evaluation and Latency Budget
Google Maps API Design Decisions